import request from '@/utils/request'

export function listLedger(query) {
    return request({
        url: '/resource/drug/list',
        method: 'get',
        params: query
    })
}

export function delRoomRecord(recordIds) {
    return request({
        url: '/resource/room/record/delete/' + recordIds,
        method: 'delete',
    })
}

export function checkListLedger(query) {
    return request({
        url: '/resource/room/record/list',
        method: 'get',
        params: query
    })
}

export function bzwzList(query) {
    return request({
        url: '/resource/bzwz/jcxm/list',
        method: 'get',
        params: query
    })
}

export function delHxypList(drugIds) {
    return request({
        url: '/resource/drug/delete/' + drugIds,
        method: 'delete',
    })
}

export function hxypViewForm(drugId) {
    return request({
        url: '/resource/drug/' + drugId,
        method: 'get',
    })
}

export function addHxyp(query) {
    return request({
        url: '/resource/drug',
        method: 'post',
        data: query
    })
}

export function addRoomTable(query) {
    return request({
        url: '/resource/room/record',
        method: 'post',
        data: query
    })
}

export function bzwzOut(query) {
    return request({
        url: '/resource/bzwz/out',
        method: 'put',
        data: query
    })
}

export function batchHxypOut(query) {
    return request({
        url: '/resource/drug/out',
        method: 'post',
        data: query
    })
}

export function roomSave(query) {
    return request({
        url: '/resource/room',
        method: 'post',
        data: query
    })
}

export function getJcxmList() {
    return request({
        url: '/resource/bzwz/jcxm/bucketList',
        method: 'get',
    })
}

// 查询领用记录列表
export function listRoomList(query) {
    return request({
        url: '/resource/room/list',
        method: 'get',
        params: query
    })
}

// 超期处置列表查询
export function listDelayHandle(query) {
    return request({
        url: '/resource/bzwz/delayHandle/list',
        method: 'get',
        params: query
    })
}

// 处置按钮查询
export function handleForm(bzwzIds) {
    return request({
        url: 'resource/bzwz/handle/batch/' + bzwzIds,
        method: 'get',
    })
}

// 超期处置保存
export function saveBatchHandle(query) {
    return request({
        url: '/resource/bzwz/handle/batch',
        method: 'post',
        data: query
    })
}

export function getTotalPrice() {
    return request({
        url: '/resource/bzwz/out/count',
        method: 'get',
    })
}

export function listHandle(query) {
    return request({
        url: '/resource/bzwz/handle/list',
        method: 'get',
        params: query
    })
}

export function getRemainGg(drugId) {
    return request({
        url: '/resource/drug/count/' + drugId,
        method: 'get',
    })
}

export function saveRemainGg(query) {
    return request({
        url: '/resource/drug/updateCount',
        method: 'put',
        data: query
    })
}

export function formRoom(roomId) {
    return request({
        url: '/resource/room/' + roomId,
        method: 'get',
    })
}

export function recordEdit(recordId) {
    return request({
        url: '/resource/room/record/' + recordId,
        method: 'get',
    })
}